package xlj.lib.android.base.component;

import android.content.Context;

import com.kaopiz.kprogresshud.KProgressHUD;

public class LoadingDialog {
    private static KProgressHUD progressHUD;

    public static void show(String message, Context context) {
        dismiss();
        progressHUD = KProgressHUD.create(context);
        progressHUD.setCornerRadius(5).setLabel(message)
                .setStyle(KProgressHUD.Style.SPIN_INDETERMINATE)
                .show();
    }

    public static void dismiss() {
        if (progressHUD != null) {
            progressHUD.dismiss();
            progressHUD = null;
        }
    }
}
